<template>
  <div>
    <!-- 筛选门店 -->
    <div style="margin-bottom: 20px">
      <el-input type="text" v-model="storename" placeholder="请输入门店名称" style="width: 85%"></el-input>
      <el-button @click="chooseShop" style="width: 15%">选择门店</el-button>
    </div>
    <!-- 门店表格 -->
    <div class="x_goodsTable">
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column fixed prop="storename" label="门店名称" width="600"> </el-table-column>
        <el-table-column fixed="right" label="操作">
          <template slot-scope="scope">
            <el-button type="text" @click="choice(scope.row)">选择</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>

    <!-- 分页 -->
    <div style="heigth: 50px; margin-top: 20px; margin-right: 0">
      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="page" :page-size="size" layout="prev, pager, next" :total="count">
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      storename: '',
      tableData: [],
      // 分页
      total: 0,
      arr: [],
      size: 3,
      page: 1,
      count: 0,
    }
  },
  created() {},
  methods: {
    // 分页

    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
      this.page = val
      this.fn()
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
      this.page = val
      this.fn()
    },
    //搜索选择门店
    chooseShop() {
      this.$emit('choosep', { title: this.storename, flage: false })
    },
    //选择门店
    choice(row) {
      this.$emit('choicep', { falge: false, title: row.storename })
    },
  },
}
</script>

<style></style>
